<?php
/**
 * gpa_new Description
 * @package
 * @name controller_home
 * @filesource controller_home.php
 * @author Hanny Setiawan
 */

class controller_home extends Controller
{
    /**
     * @access public
     * @method __construct
     * @param void
     * @return void
     */
    public function  __construct()
    {
        parent::__construct();
    }

    public function __default()
    {
        $model = $this->getModel();
        $model_screening = $this->getModel('screening');

        //var_dump($model_screening->getStepOneImages());
        //exit;

        $slideshows = $model->getEditorChoiceImages();
        $slideshow_datas = '{';
        $i = 0;
        foreach($slideshows as $slide) {
            if($i) { $slideshow_datas .= ', '; }
            $slideshow_datas .= "'".$slide['href']."':{caption: '".$slide['title']."', href: '".$slide['url']."', thumbnail: '".$slide['thumb']."'}";
            $i++;
        }
        $slideshow_datas .= '}';
        
        $model_menu = $this->getModel('menu');
        $mainMenus = $model_menu->getMenus();
        $var['mainmenus'] = createMenus($mainMenus);
        $var['usermenus'] = createUserMenus();
        $var['slideshow_datas'] = $slideshow_datas;
        $var['new_screening'] = $model_screening->getStepOneImages(0,10);
        $this->addVars($var);
        $this->renderView("home_html");
        
    }
}
?>